package com.gwtsz.chart.output.utils;

import com.gwtsz.chart.renderer.BarChartRenderer;
import com.gwtsz.chart.renderer.LineChartRenderer;
import java.util.HashMap;

/**
 * Created by spence on 17-3-23.
 */

public class ChartRendererFactory {

  public enum ChartRendererType {
    //蜡烛型图表,棒形图表,线性图表
    CANDLE_STICK(0), BAR_CHART(1), LINE_CHART(2);

    private static ChartRendererType[] allTypes = { CANDLE_STICK, BAR_CHART, LINE_CHART };
    private int type;

    ChartRendererType(int type) {
      this.type = type;
    }

    /**
     * 返回k线类型
     * @return
     */
    public int typeId() {
      return type;
    }

    public static ChartRendererType getType(int type) {
      for (ChartRendererType rtype : allTypes) {
        if (rtype.type == type)
          return rtype;
      }
      return ChartRendererType.BAR_CHART;
    }
  }



}
